#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    long long a, b, T, n;
    cin >> T;
    while (T--)
    {
        long long cost = 0;
        cin >> n >> a >> b;
        long long man = 3 * a > 2 * b ? 3 : 2;
        long long spend = 3 * a > 2 * b ? b : a;
        cost += (n / man * spend);
        if (n <= 2)
        {
            cost = min(a, b);
        }
        else if (man == 2 && n % man == 1)
        {
            cost += min(a, b - a);
        }
        else if (man == 3 && n % man == 1)
        {
            cost += min(b, min(a, 2 * a - b));
        }
        else if (man == 3 && n % man == 2)
        {
            cost += min(a, min(b, 3 * a - b));
        }
        cout << cost << endl;
    }
    return 0;
}